<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Any4Chat</title>
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <link rel="stylesheet" href="/static/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/css/a4a.css">
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>Any4Chat</h1>
            <p>控制台 丨 <a href="/chat" target="_blank">测试页面</a></p>
        </div>
        
        <div class="app-container">
            <div class="app-sidebar">
                <div class="sidebar-section">
                    <h3><i class="fas fa-list"></i> 待预览内容</h3>
                    <div class="preview-list" id="previewList">
                        <div class="empty-state">
                            <i class="fas fa-inbox"></i>
                            <p>暂无待预览内容</p>
                        </div>
                    </div>
                </div>

                <div class="sidebar-section">
                    <h3><i class="fas fa-chart-bar"></i> 统计</h3>
                    <div class="stats">
                        <div class="setting-item" style="display: flex;" id="conversationStats">
                            <label class="setting-label">
                                <a href="/conversations" target="_blank"><i class="fas fa-comments"></i> 全部会话</a>
                            </label>
                            <div class="setting-control">
                                <span class="conversation-count-badge" id="conversationCount" title="点击查看全部会话列表">
                                    0
                                </span>
                            </div>
                        </div>
                        <div class="setting-item" style="display: flex;" id="approvedStats">
                            <label class="setting-label">
                                <a href="/preview" target="_blank"><i class="fas fa-check-circle"></i> 已回复</a>
                            </label>
                            <div class="setting-control">
                                <span class="preview-count-badge" id="approvedCount" title="点击查看已回复列表">
                                    0
                                </span>
                            </div>
                        </div>
                        <div class="setting-item" style="display: flex;" id="timeoutStats">
                            <label class="setting-label">
                                <a href="/timeout" target="_blank"><i class="fas fa-exclamation-triangle"></i> 超时响应</a>
                            </label>
                            <div class="setting-control">
                                <span class="timeout-count-badge" id="timeoutCount">
                                    0
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="app-main">
                <div class="preview-detail" id="previewDetail">
                    <div class="empty-state" id="emptyState">
                        <i class="fas fa-search"></i>
                        <p>请选择一项内容预览</p>
                    </div>
                    <div class="content-editor-container" id="editorContainer" style="display: none;">
                        <textarea class="content-editor" id="contentEditor" placeholder="编辑内容..."></textarea>
                        <div class="content-preview" id="contentPreview"></div>
                        <div class="editor-actions">
                            <button class="layui-btn layui-btn-normal" id="saveAndSendBtn"><i class="fas fa-save"></i> 保存发送</button>
                            <button class="layui-btn layui-btn-primary" id="cancelBtn"><i class="fas fa-times"></i> 取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- 引入公共函数库 -->
    <script src="/static/js/index/common/content-processor.js"></script>
    <script src="/static/js/index/common/api-service.js"></script>
    <script src="/static/js/index/common/ui-utils.js"></script>
    <script src="/static/js/index/common/data-manager.js"></script>

    <!-- 引入主控制器 -->
    <script src="/static/js/index/index.js"></script>

    <!-- 引入第三方库 -->
    <script src="/static/layui/layui.js"></script>
    <script src="/static/js/marked.min.js"></script>
</body>
</html>